How to: Display part of a date field using a calculated field.
Solution:
Click the 'Queries' tab in the Database window, click 'New', and select 'Design View' from the list box. Type the desired 'DatePart(datepart,date)' expressions in the 'Criteria' cell(s) of the appropriate fields.
1) If the Database window is not active, activate the Database window.
2) Click the 'Queries' tab in the Database window.
Queries tab
3) Click 'New'. (The New Query dialog box appears.)
4) Select 'Design View' in the 'New Query' list box.
5) Click 'OK'. (The Show Table dialog box appears.)
6) Select the table to be used in the query.
7) Click 'Add'. (The table appears behind the dialog box.)
8) Click 'Close'. (The Query design view appears.)
9) To add fields to the query:
a) Select a field from a table's field list box in the top half of the Query Design window.
b) Drag the field to the desired column of the design grid in the bottom half of the Query Design window.
Design grid
c) Release the mouse button. (The field name appears in the Field row, and its table appears in the Table row.)
Field row and Table row
d) Repeat steps 9)a) through 9)c) for each field to be added to the query.
NOTE: Fields can also be added to the query by selecting a field from the drop-down list in the 'Field' row of the design grid in the bottom half of the Query Design window.
Design grid
10) To create an expression in the desired field, do the following:
a) Click in the 'Criteria' cell of the desired field.
b) Type the criteria using the desired 'DatePart(datepart,date)' functions in the expression(s).
EXAMPLE 1: DatePart Example1
EXAMPLE 2: DatePart Example2
11) (Optional) Repeat steps 10)a) and 10)b) for each additional field requiring retrieval of a range of records.
12) Select the 'File' menu and select 'Save' to save the query.
13) Type the name for the query in the 'Save As' box.
14) Click 'OK'.
15) Select the 'Query' menu and select 'Run' to retrieve the range of records.